!(function(doc, win) {
  let docEl = doc.documentElement,
    resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
    recalc = function() {
      const clientWidth = docEl.clientWidth
      if (!clientWidth) return
      docEl.style.fontSize = 100 * (clientWidth / 1920) + 'px'
    }
  win.addEventListener(resizeEvt, recalc, true)
  doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)
